package com.klun.concTrueWar.five;

import javax.servlet.*;
import java.io.IOException;
import java.math.BigInteger;

/**
 * TODO 没看懂这个
 * 在因式分解 servlet 中使用 Memoizer 来缓存结果
 */
public class Factorizer implements Servlet{
    private final Computable<BigInteger,BigInteger[]> c =
        new Computable<BigInteger, BigInteger[]>() {
            @Override
            public BigInteger[] compute(BigInteger arg) throws InterruptedException {
                return new BigInteger[0];
            }
        };
    private final Computable<BigInteger,BigInteger[]> cache =
            new MemoizerLast<>(c);
    @Override
    public void service(ServletRequest req, ServletResponse resp) throws ServletException, IOException {
//        try{
//            BigInteger i = extractFromRequest(req);
//        }catch (InterruptedException e){
//
//        }
    }

    @Override
    public void init(ServletConfig servletConfig) throws ServletException {
    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }


    @Override
    public String getServletInfo() {
        return null;
    }
    @Override
    public void destroy() {

    }
}
